package org.example.xls.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.xls.pojo.User;
import org.example.xls.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 用户登录接口
     * @param code
     * @return
     */
    @GetMapping("/login")
    User login(@RequestParam("code") String code){
        log.info("code:{}",code);
        return loginService.login(code);
    }
}